﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Resources;
using System.Windows.Media.Imaging;

namespace PowerArrow.nasa.View.Compont
{
    public partial class NumLevel : UserControl
    {
        public NumLevel()
        {
            InitializeComponent();
        }


        #region NumProperty
        public string Num
        {
            get { return (string)GetValue(NumProperty); }
            set { SetValue(NumProperty, value); }
        }
        public static readonly DependencyProperty NumProperty =
            DependencyProperty.Register("Num", typeof(string), typeof(NumLevel), new PropertyMetadata("1", OnNumPropertyChanged));

        private static void OnNumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumLevel num01 = d as NumLevel;
            num01.NumChanged((string)e.NewValue);
        }

        private void NumChanged(string str)
        {
            StreamResourceInfo sri = Application.GetResourceStream(new Uri("PowerArrow;component/assets/0" + str + ".png", UriKind.Relative));
            BitmapImage bi = new BitmapImage();
            bi.SetSource(sri.Stream);
            Image img = new Image();
            xImage.Source = bi;
        }
        #endregion
    }
}
